home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 205 / 205.d81 / eliza talk (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  9KB  |  234 lines

  1. 0 poke646,1:poke53272,20
  2. 1 rem the original program is from the         book: more basic computer games
  3. 2 rem  by david h. ahl, copyright 1979         by creative computing
  4. 4 rem the talking technology is from           software automatic mouth (s.a.m.)
  5. 5 rem modifications to eliza's routines        and the adding of its voice are
  6. 6 rem  by marv bero  version 2.4  apr'85
  7. 8 rem thanks go to joe gomboc for help         on integrating the talking
  8. 10 rem please note: eliza does not like         vulgarities or being sworn at
  9. 100 print chr$(147):print:print:print
  10. 110 print"              talking eliza"
  11. 120 print"              [183][183][183][183][183][183][183][183][183][183][183][183][183]"
  12. 130 ifpeek(850)<>123thenprint"              please wait!"
  13. 140 ifpeek(850)<>123then poke850,123:poke55,0:poke56,125:clr:load"+eliza",8,1
  14. 150 poke39438,72:poke39439,64:sys38144
  15. 160 poke39733,255:poke39734,255:poke39735,255
  16. 170 print "   to end program, include the words"
  17. 180 print:print "       'shut up' in your response"
  18. 190 sa$="to end program, include the words   shut up in your re sponce"
  19. 191 poke53270,200:sys39430:poke53271,0
  20. 200 rem  -----initialization-----
  21. 210 dim s(41),r(41),n(41)
  22. 220 n1=41:n2=16:n3=115:rr=0
  23. 230 for x=1ton1+n2+n3:readz$:next x
  24. 240 for x=1ton1
  25. 250 read s(x),l:r(x)=s(x):n(x)=s(x)+l-1
  26. 260 next x
  27. 270 print" hi!  i'm eliza.  what's your problem?":print
  28. 280 sa$=" hi!  i'm e lie za.  what's your problum?"
  29. 281 poke53270,200:sys39430:poke53271,0
  30. 290 rem  -----user input section-----
  31. 300 if left$(f$,12)="you continue" then print:goto830
  32. 310 print:input" ";i$
  33. 320 i$="[160]"+i$+" "
  34. 330 rem get rid of apostrophes
  35. 340 for l=1 to len(i$)
  36. 350 if mid$(i$,l,1)="'"theni$=left$(i$,l-1)+right$(i$,len(i$)-l):goto350
  37. 360 zw$="shutting up..."
  38. 370 ifl+7<=len(i$)thenifmid$(i$,l,7)="shut up"then39990
  39. 380 next l
  40. 390 zv$="please don't repeat yourself again!"
  41. 400 if i$=p$ then rr=rr+1
  42. 405 if rr=2then rr=0:print:printzv$:sa$=zv$:gosub39980:goto300
  43. 410 rem   -----find keyword in i$-----
  44. 420 restore
  45. 430 s=0
  46. 440 for k=1 to n1
  47. 450 read k$
  48. 460 if s>0 then 500
  49. 470 for l=1 to len(i$)-len(k$)+1
  50. 480 if mid$(i$,l,len(k$))=k$ then s=k:t=l:f$=k$
  51. 490 nextl
  52. 500 nextk
  53. 510 if s>0 thenk=s:l=t:goto530
  54. 520 k=36:goto760:rem no keywords found
  55. 530 rem  --take right part of string andconjugate it using list of strings
  56. 540 restore
  57. 550 for x=1 to n1:read z$:next x:rem skip keywords
  58. 560 c$=" "+right$(i$,len(i$)-len(f$)-l+1)+"[160]"
  59. 570 for x=1 to n2/2
  60. 580 read s$,r$
  61. 590 for l=1 to len(c$)
  62. 600 if l+len(s$)>len(c$) then 650
  63. 610 if mid$(c$,l,len(s$))<>s$ then 650
  64. 620 c$=left$(c$,l-1)+r$+right$(c$,len(c$)-l-len(s$)+1)
  65. 630 l=l+len (r$)
  66. 640 goto 690
  67. 650 if l+len(r$)>len(c$) then 690
  68. 660 if mid$(c$,l,len(r$))<>r$ then 690
  69. 670 c$=left$(c$,l-1)+s$+right$(c$,len(c$)-l-len(r$)+1)
  70. 680 l=l+len(s$)
  71. 690 next l
  72. 700 next x
  73. 710 if mid$(c$,2,1)=" " then c$=right$(c$,len(c$)-1): rem only 1 space
  74. 720 for l=1 to len(c$)
  75. 730 if mid$(c$,l,1)="!" then c$=left$(c$,l-1)+right$(c$,len(c$)-l):goto 730
  76. 740 next l
  77. 750 rem use keyword # (k) to get reply
  78. 760 restore
  79. 770 for x=1 to n1+n2:read z$:next x
  80. 780 for x=1 to r(k): read f$:next x:rem read right reply
  81. 790 r(k)=r(k)+1:ifr(k)>n(k)thenr(k)=s(k)
  82. 800 if right$(f$,1)<>"*" then print:print f$:sa$=f$:gosub39980:p$=i$: goto 290
  83. 810 print:zz$=left$(f$,len(f$)-1):printzz$;c$:sa$=zz$+" "+c$:gosub39980
  84. 820 p$=i$: goto 290
  85. 830 zy$="perhaps when you can keep a civil tongue we can try again...":printzy$
  86. 840 sa$=zy$:gosub39980:end
  87. 850 rem  ---programme data keywords---
  88. 870 data "fuck","shit","screw you","go to hell","goddam"
  89. 880 data "can you","can i","you are","youre","i dont","i feel"
  90. 890 data "why dont you","why cant i","are you","i cant","i am","im "
  91. 900 data "you ","i want","what","how","who","where","when","why"
  92. 910 data "name","cause","sorry","dream","hello","hi ","maybe"
  93. 920 data " no","your ","always","think","alike","yes","friend"
  94. 930 data "computer","nokeyfound"
  95. 940 rem   string data for conjugations
  96. 950 data " are "," am ","were ","was "
  97. 960 data " you "," i ","your ","my "
  98. 970 data " ive "," youve "," im ","youre "
  99. 980 data " me "," !you "," myself "," yourself "
  100. 990 rem   replies
  101. 1000 data "please don't swear or curse"
  102. 1010 data "if you continue to swear, i'll have to  end our session"
  103. 1020 data "you continue to swear despite my warning  the session is finished!"
  104. 1030 data"don't you believe that i can*"
  105. 1040 data "perhaps you would like to be able to*"
  106. 1050 data "you want me to be able to*"
  107. 1060 data "perhaps you don't want to*"
  108. 1070 data "do you want to be able to*"
  109. 1080 data "what makes you think i am*"
  110. 1090 data "does it please you to believe that i am*"
  111. 1100 data"perhaps you would like to be*"
  112. 1110 data "do you sometimes wish you were*"
  113. 1120 data "don't you really*"
  114. 1130 data "why don't you*"
  115. 1140 data "do you wish to be able to*"
  116. 1150 data "does that trouble you?"
  117. 1160 data "tell me more about these feelings."
  118. 1170 data "do you often feel*"
  119. 1180 data "do you enjoy feeling*"
  120. 1190 data "do you really believe i don't*"
  121. 1200 data "perhaps in good time i will*"
  122. 1210 data "do you want me to*"
  123. 1220 data "do you think you should be able to*"
  124. 1230 data "why can't you*"
  125. 1240 data "why are you interested in wether or not i am*"
  126. 1250 data "would you prefer if i were not*"
  127. 1260 data "perhaps in your fantasies i am*"
  128. 1270 data "how do you know you can't*"
  129. 1280 data "have you tried?"
  130. 1290 data "perhaps you can now*"
  131. 1300 data "did you come to me because you are*"
  132. 1310 data "how long have you been*"
  133. 1320 data "do you believe it is normal to be*"
  134. 1330 data "do you enjoy being*"
  135. 1340 data "we were discussing you-- not me."
  136. 1350 data "oh, i*"
  137. 1360 data "you're not really talking about me, are you?"
  138. 1370 data "what would it mean to you if you got*"
  139. 1380 data "why do you want*"
  140. 1390 data "suppose you were soon to get*"
  141. 1400 data "what if you never got*"
  142. 1410 data "i sometimes also want"
  143. 1420 data"why do you ask?"
  144. 1430 data "does that question interest you?"
  145. 1440 data "what answer would please you the most?"
  146. 1450 data "what do you think?"
  147. 1460 data "are such questions on your mind often?"
  148. 1470 data "what is it that you really want to know?"
  149. 1480 data "have you asked anyone else?"
  150. 1490 data "have you asked this sort of question before?"
  151. 1500 data "what else comes to mind when you ask that?"
  152. 1510 data "names don't interest me."
  153. 1520 data "i don't care about names-- please go on."
  154. 1530 data "is that the real reason?"
  155. 1540 data "don't any other reasons come to mind?"
  156. 1550 data "does that reason explain anything else?"
  157. 1560 data "what other reasons might there be?"
  158. 1570 data "please don't apologize!"
  159. 1580 data "apologies aren't necessary."
  160. 1590 data "what feelings do you have when you apologize?"
  161. 1600 data "don't be so defensive!"
  162. 1610 data "what does that dream suggest to you?"
  163. 1620 data "do you dream often?"
  164. 1630 data "which people appear in your dreams?"
  165. 1640 data "are you disturbed by your dreams?"
  166. 1650 data "how do you do ... please state your problem."
  167. 1660 data "you don't seem quite certain."
  168. 1670 data "why the uncertain tone?"
  169. 1680 data "can't you be more positive?"
  170. 1690 data "you aren't sure?"
  171. 1700 data "don't you know?"
  172. 1710 data "are you saying no just to be negative?"
  173. 1720 data "you are being a bit negative."
  174. 1730 data "why not?"
  175. 1740 data "are you sure?"
  176. 1750 data "why no?"
  177. 1760 data "why are you concerned about my*"
  178. 1770 data "what about your own*"
  179. 1780 data "can you think of a specific example?"
  180. 1790 data "when?"
  181. 1800 data "what are you thinking of?"
  182. 1810 data "really, always?"
  183. 1820 data "do you really think so?"
  184. 1830 data "but you are not sure that you*"
  185. 1840 data "do you doubt that you*"
  186. 1850 data "in what way?"
  187. 1860 data "what resemblance do you see?"
  188. 1870 data "what does the similarity suggest to you?"
  189. 1880 data "what other connections do you see?"
  190. 1890 data "could there really be some connection?"
  191. 1900 data "how?"
  192. 1910 data "you seem quite positive."
  193. 1920 data "are you sure?"
  194. 1930 data "i see."
  195. 1940 data "i understand."
  196. 1950 data "why do you bring up the topic of freinds"
  197. 1960 data "do your friends worry you?"
  198. 1970 data "do your friends pick on you?"
  199. 1980 data "are you sure you have any friends?"
  200. 1990 data "do you impose on your friends?"
  201. 2000 data "perhaps y